<script setup lang="ts">
import { ref } from 'vue';
</script>

<template>
  <page class="page" custom-overflow="visible">
    <page-template footerBtnTitle="点击查看更多" :footerBtnIcon="true">
      <view class="head"></view>
      <view class="banner">
        <view class="banner-item" v-for="item in 2" :key="item">
          <view class="banner-item-left">
            <view class="banner-item-title">Pura 70 Ultra</view>
            <view class="banner-item-desc">探索未见之美</view>
            <hire-button bgColor="#FD5701" title="租">
                <price-box style="margin-right: 10rpx;" num="15.24" color="#FFFFFF"></price-box>
            </hire-button>
          </view> 
          <image src="https://meizuly.oss-cn-shanghai.aliyuncs.com/xcxPic/h5/pura-70.png" mode="aspectFill"></image> 
        </view>
      </view>
      <view class="single" v-for="item in 2" :key="item">
        <view class="single-head">
          <image src="https://meizuly.oss-cn-shanghai.aliyuncs.com/xcxPic/h5/pura-70.png" mode="aspectFill"></image> 
          <view class="right">
            <view class="title-box">
              <mark-tips></mark-tips>
              <text class="text">Pura 70 Ultra</text>
            </view>
            <view class="price-box">
              <view class="discount">
                <view class="discount-tip">立减</view>
                <view class="discount-price">
                  <view class="unit">￥</view>
                  <view>600</view>
                </view>
              </view>
              <view class="price-right">
                <view class="price-right-title">探索未见之美 打开全新视界</view>
                <hire-button bgColor="#FD5701" title="立即抢租" >
                  <view class="price-right-num">
                    <price-box num="15.24" color="#FFFFFF"></price-box>
                  </view>
                </hire-button>
              </view>
            </view>
          </view>
        </view>
        <view class="single-body">
          <view class="single-body-item" v-for="item in 3" :key="item">
            <image src="https://meizuly.oss-cn-shanghai.aliyuncs.com/xcxPic/h5/pura-70.png" mode="aspectFill"></image> 
            <view class="single-body-item-title">2K E7 超色准屏<view>
          </view>
        </view>
      </view>
      </view>
      </view>
      <view class="series" v-for="series in 2" :key="series">
        <view class="series-head"></view>
        <view class="series-body">
          <view class="series-item" v-for="item in series ==1 ? 2 : 4" :key="item">
            <image src="https://meizuly.oss-cn-shanghai.aliyuncs.com/xcxPic/h5/pura-70.png" mode="aspectFill"></image> 
            <view class="series-item-mark"><mark-tips></mark-tips><discount-button style="margin-left: 6rpx;"></discount-button></view>
            <view class="series-item-title">Pura 70 Ultra</view>
            <view class="series-item-bottom">
              <view class="series-item-bottom-left">
                <view class="discount-tip">立减</view>
                <view class="discount-price">
                  <view class="unit">￥</view>
                  <view>600</view>
                </view>
                <view class="price">
                  <price-box num="15.24" color="#FF1717"></price-box>
                </view>

              </view>
              <hire-button bgColor="#FD5701" title="抢租" ></hire-button>
            </view>
          </view>
        </view>
      </view>
    </page-template>
  </page>
</template>
<style lang="scss" scoped>
.head{
  margin: 0 -20rpx;
  height: 710rpx;
  background: url('https://meizuly.oss-cn-shanghai.aliyuncs.com/xcxPic/h5/xiaomi-head.png') no-repeat;
  background-size: 100% 100%;
}
.banner{
  padding: 0 10rpx;
  margin-top: -144rpx;
  height: 188rpx;
  display: flex;
  background: url('https://meizuly.oss-cn-shanghai.aliyuncs.com/xcxPic/h5/xiaomi-banner.png') no-repeat;
  background-size: 100% 100%;
  &-item{
    padding: 10rpx 6rpx;
    display: flex;
    align-items: center;
    width: calc( 50% - 10rpx);
    margin-right: 20rpx;
    &:last-child{
      margin-right: 0;
    }
    &-title{
      font-family: Alibaba PuHuiTi;
      font-weight: bold;
      font-size: 29rpx;
      color: #000000;
      line-height: 41rpx;
    }
    &-desc{
      margin: 6rpx 0;
      font-family: PingFang SC;
      font-weight: bold;
      font-size: 24rpx;
      color: #999999;
      line-height: 33rpx;
    }
    image{
      flex-shrink: 0;
      margin-left: 8rpx;
      width: 124rpx;
      height: 154rpx;
      border-radius: 18rpx;
    }
  }
}
.single{
  margin-top: 20rpx;
  padding: 12rpx 10rpx;
  background: #FFFFFF;
  border-radius: 20rpx;
  &-head{
    display: flex;
    image{
      width: 164rpx;
      height: 196rpx;
      border-radius: 18rpx;
    }
    .right{
      flex: 1;
      margin-left: 20rpx;
      padding-top: 10rpx;
      padding-bottom:20rpx;
      .title-box{
        display: flex;
        align-items: center;
        .text{
          margin-left: 6rpx;
          font-family: Alibaba PuHuiTi;
          font-weight: bold;
          font-size: 34rpx;
          color: #000000;
          line-height: 47rpx;
        }
      }
      .price-box{
        display: flex;
        align-items: flex-end;
        .discount{
          padding-top: 20rpx;
          padding-right: 40rpx;
          flex-shrink: 0;
          background: url('https://meizuly.oss-cn-shanghai.aliyuncs.com/xcxPic/h5/price-icon.png') no-repeat;
          background-size: 100% 100%;
          width: 204rpx;
          height: 113rpx;
          &-tip{
            text-align: right;
            font-family: Alibaba PuHuiTi;
            font-weight: 400;
            font-size: 26rpx;
            color: #FFFFFF;
            line-height: 35rpx;
            text-shadow: 0px 3px 10px #FF0000;
          }
          &-price{
            display: flex;
            justify-content: flex-end;
            font-family: Alibaba PuHuiTi;
            font-weight: 400;
            font-size: 30rpx;
            color: #FFFFFF;
            line-height: 27rpx;
            text-shadow: 0px 3px 10px #FF2020;
            .unit{
              font-size: 22rpx;
            }
          }
        }
      }
      .price-right{
        &-title{
          margin-bottom: 10rpx;
          font-family: PingFang SC, PingFang SC;
          font-weight: bold;
          font-size: 20rpx;
          color: #FD5600;
          line-height: 28rpx;
        }
        &-num{
          margin-right: 11rpx; 
          padding-right: 10rpx;
          position: relative;
          &::after{
            content: '';
            position: absolute;
            right: 0;
            top: 12rpx;
            bottom: 12rpx;
            width: 1rpx;
            background: #ffffff;
          }
        }
      }
    }
  }
  &-body{
    display: flex;
    background: #F2F3F5;
    border-radius: 20rpx;
    padding: 20rpx;
    &-item{
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      position: relative;
      &:after{
        content: '';
        position: absolute;
        right: 0;
        top: 12rpx;
        bottom: 12rpx;
        width: 1rpx;
        background: #eeeeee;
      }
      &:last-child{
        &::after{
          display: none;
        }
      }
      image{
        margin-bottom: 12rpx;
        width: 100rpx;
        height: 68rpx;
        border-radius: 6rpx;
      }
      &-title{
        font-family: PingFang SC, PingFang SC;
        font-weight: bold;
        font-size: 20rpx;
        color: #333333;
        line-height: 28rpx;
      }
    }
  }
}
.series{
  margin-top: 10rpx;
  &:last-child{
    margin-bottom: 20rpx;
  }
  &-head{
    height: 158rpx;
    background: url('https://meizuly.oss-cn-shanghai.aliyuncs.com/xcxPic/h5/red-series.png') no-repeat;
    background-size: 100% 100%;
  }
  &-body{
    display: flex;
    flex-wrap: wrap;
  }
  &-item{
    margin-top: 10rpx;
    padding: 18rpx 8rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(50% - 5rpx);
    margin-right: 10rpx;
    background: #FFFFFF;
    border-radius: 20rpx;
    &:nth-child(2n){
      margin-right: 0;
    }
    image{
      margin-bottom: 14rpx;
      width: 168rpx;
      height: 202rpx;
      border-radius: 18rpx;
    }
    &-mark{
      margin-bottom: 4rpx;
      display: flex;
    }
    &-title{
      font-family: Alibaba PuHuiTi;
      font-weight: bold;
      font-size: 29rpx;
      color: #000000;
      line-height: 41rpx;
    }
    &-bottom{
      margin-top: -16rpx;
      display: flex;
      align-items: flex-end;
      &-left{
        flex-shrink: 0;
        padding-top: 20rpx;
        padding-right: 60rpx;
        width: 240rpx;
        height: 110rpx;
        position: relative;
        background: url('https://meizuly.oss-cn-shanghai.aliyuncs.com/xcxPic/h5/price-icon.png') no-repeat;
        background-size: 100% 100%;
        .discount-tip{
          text-align: right;
          font-family: Alibaba PuHuiTi;
          font-weight: 400;
          font-size: 26rpx;
          color: #FFFFFF;
          line-height: 35rpx;
          text-shadow: 0px 3px 10px #FF0000;
        }
        .discount-price{
          display: flex;
          justify-content: flex-end;
          font-family: Alibaba PuHuiTi;
          font-weight: 400;
          font-size: 30rpx;
          color: #FFFFFF;
          line-height: 27rpx;
          text-shadow: 0px 3px 10px #FF2020;
          .unit{
            font-size: 22rpx;
          }
        }
        .price{
          position: absolute;
          left: 0;
          bottom: -18rpx;
        }
      }
    }
  }
}
</style>